﻿using System;
using System.Linq;
using DAL;
using Entity;
using Utils;
using Library;
using DataContext;
using System.Collections.Generic;

namespace HighLowGameBLL
{
    public class CtrHiLoHelp
    {
        public int InsertHiLoHelp(int hiLoGameId, string title, string content, string description, int type, int status, ref int? id)
        {
            return DB.HighLowGameInstance.uspHiLoHelpInsert(hiLoGameId, title, content, description, type, status, ref id);
        }

        public int UpdateHiLoHelp(int id, int? hiLoGameId, string title, string content, string description, int? type, int? status)
        {
            return DB.HighLowGameInstance.uspHiLoHelpUpdate(id, hiLoGameId, title, content, description, type, status);
        }

        public int UpdateHiLoHelp(int id, int status)
        {
            return UpdateHiLoHelp(id, null, null, null, null, null, status);
        }

        public uspHiLoHelpSelectResult SelectHiLoHelp(int id)
        {
            return DB.HighLowGameInstance.uspHiLoHelpSelect(id).FirstOrDefault();
        }

        public List<uspHiLoHelpSelectByResult> SelectHiLoHelpBy(int hiLoGameId, string title, int type, int status, int currentPage, int pageSize, ref int? totalRecord)
        {
            return DB.HighLowGameInstance.uspHiLoHelpSelectBy(hiLoGameId, title, type, status, currentPage, pageSize, ref totalRecord).ToList();
        }

        public int DeleteHiLoHelp(int id)
        {
            return DB.HighLowGameInstance.uspHiLoHelpDelete(id);
        }
    }
}
